package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        try {
            FileOutputStream fos=new FileOutputStream("fos.dat");
            fos.write(1);
            fos.close();
        } catch (IOException e) {
            System.out.println("出错了！");
        } finally {
            try {
              //  if(fos!=null)
              //  fos.close();
            } catch (Exception e) {
                System.out.println("出错了");
            }

        }
    }
}
